<!doctype html>
<html lang="en">

	<head>
		<meta charset="UTF-8" />
		<title></title>
		<script src="html5plus://ready"></script>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="../../css/mui.min.css"/>
		<style type="text/css">
			#nav {
			    background-color: #FFFFFF;
			    height: 40px;
			}
			.mui-bar-tab .mui-tab-item{
				height: 40px;
			}
			.mui-bar{
				box-shadow: 0 0 1px #fff;
			}
			.line{
				height: 1px;
				width: 100%;
				background: #C8C7CC;
				position: fixed;
				bottom: 40.5px;
				content:'';
				-webkit-transform: scaleY(.5);
				transform:scaleY(.5);
			}
			.mui-bar .mui-icon {
			    padding-top: 0px; 
			    padding-bottom: 0px; 
			}
		</style>
	</head>

	<body>
		<div class="line"></div>
		<nav class="mui-bar mui-bar-tab" id="nav">			
			<a class="mui-tab-item mui-icon icon  iconfont mui-icon-arrowleft" id="houtui">
			</a>
			<!--<a class="mui-tab-item mui-icon icon iconfont mui-icon-home" id="shouye">
			</a>-->
			<a class="mui-tab-item mui-icon icon iconfont mui-icon-arrowright" id="qianjin">	
			</a>
		</nav>
	</body>
	<script src="../../js/mui.min.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
			mui.init();
			var gourl = 'https://m.2339.com/?union=zhangxy_h5';
			var baiduWV = plus.webview.create(gourl, "shilu", {
				top: 0,
				bottom: 40
			});
			baiduWV.setCssFile('_www/css/page/preload.css');
			plus.webview.currentWebview().append(baiduWV);
		
			baiduWV.addEventListener('loading', function(e){
				jiancha();
			}, false);
			baiduWV.addEventListener('loaded', function(e){
				jiancha();
			}, false);
			
			var backButtonPress = 0;
			mui("#nav").on("tap", "a", function() {
				switch (this.getAttribute('id')){
					case 'houtui':
						baiduWV.back();
						break;
					case 'qianjin':
						baiduWV.forward();
						break;
					default:
						backButtonPress += 1;
						if(backButtonPress > 1) {
							mui.back()
						} else {
							plus.nativeUI.toast('再按一次退出直播')
						}
						setTimeout(function() {
							backButtonPress = 0
						}, 1000);
						break;
				}
			})
			function jiancha(){
				baiduWV.canBack( function(e){
					if(e.canBack == true){
						document.getElementById('houtui').style.color = "#000";
					}else{
						document.getElementById('houtui').style.color = "#ccc";
					}
				});
				baiduWV.canForward( function(e){
					if(e.canForward == true){
						document.getElementById('qianjin').style.color = "#000";
					}else{
						document.getElementById('qianjin').style.color = "#ccc";
					}
				});
			}
			
			
	</script>

</html>